package com.thinkgsp.jxc.service;

import java.sql.Date;
import java.util.List;

import com.thinkgsp.jxc.model.CheckBill;
import com.thinkgsp.jxc.model.CheckBillDetail;
import com.thinkgsp.jxc.model.CheckResult;
import com.thinkgsp.jxc.persistence.mybatis.PagingResult;

/**
 * 库房盘点业务类
 * @author evan
 *
 */
public interface CheckBillService extends GeneralService {

	/**
	 * 获取盘点单
	 * @param billId
	 * @return
	 */
	public CheckBill getCheckBill(Long billId);
	/**
	 * 获取盘点单明细
	 * @param billId
	 * @return
	 */
	public List<CheckBillDetail> getCheckBillDetail(Long billId);
	/**
	 * 查找盘点单
	 * @param begDate
	 * @param endDate
	 * @param deptId
	 * @return
	 */
	public List<CheckBill> findCheckBill(Date begDate,Date endDate,Integer deptId);
	/**
	 * 查找盘点单
	 * @param begDate
	 * @param endDate
	 * @param deptId
	 * @param start
	 * @param size
	 * @return
	 */
	public PagingResult<CheckBill> findCheckBill(Date begDate,Date endDate,Integer deptId,int start,int size);
	/**
	 * 保存盘点单
	 * @param bill
	 * @throws ServiceException
	 */
	public void saveCheckBill(CheckBill bill) throws ServiceException;
	/**
	 * 归档盘点单
	 * @param billId
	 * @throws ServiceException
	 */
	public void archiveCheckBill(long billId) throws ServiceException;
	/**
	 * 反归档盘点单
	 * @param billId
	 * @throws ServiceException
	 */
	public void unArchiveCheckBill(long billId) throws ServiceException;
	/**
	 * 删除盘点单
	 * @param billId
	 * @throws ServiceException
	 */
	public void deleteCheckBill(long billId) throws ServiceException;
	/**
	 * 录入盘点明细
	 * @param detail
	 * @throws ServiceException
	 */
	public void inputCheckBillDetail(CheckBillDetail detail) throws ServiceException;
	/**
	 * 删除盘点明细
	 * @param id
	 * @throws ServiceException
	 */
	public void deleteCheckBillDetail(long id) throws ServiceException;
	/**
	 * 试算盘损
	 * @param billId
	 * @throws ServiceException
	 */
	public List<CheckResult> testCalc(Long billId) throws ServiceException;
	/**
	 * 检查漏盘
	 */
	public List<CheckResult> findOmitedInventory(Long billId);
	
	/**
	 * 生成报损单
	 * @param billId
	 * @throws ServiceException
	 */
	public void buildLossBill(Long billId) throws ServiceException;
}
